<template>
  <div class="detail">
    <!--  导航-->
    <detail-nav-bar></detail-nav-bar>
    <detail-swiper :detailBanner="detailBanner"></detail-swiper>
  </div>
</template>

<script>
import {getDetail} from "@/network/detail";
import DetailNavBar from "@/views/detail/detailCom/DetailNavBar";
import DetailSwiper from "@/views/detail/detailCom/DetailSwiper";

export default {
  name: "Detail",
  components: {DetailSwiper, DetailNavBar},
  data() {
    return {
      goodsId: null,
      detailBanner: []
    }
  },
  created() {
    this.goodsId = this.$route.params.goodsId
    this.getDetailData(this.goodsId)
  },
  methods: {
    async getDetailData(goodsId) {
      let res = await getDetail(goodsId)
      console.log(res);
      this.detailBanner = res.result.itemInfo.topImages
    }
  }
}
</script>

<style scoped>

</style>
